Java Speech API
part 3/5 · 7.5 KB total
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• Word recognition: Compares the sequence of likely phonemes against the words and patterns of words specified by the active grammars.
• Result generation: Provides the application with information about the words the recognizer has detected in the incoming audio.
A grammar is an object in the Java Speech API that indicates what words a user is expected to say and in what patterns those words may occur. Grammars are important to speech recognizers because they constrain the recognition process. These constraints make recognition faster and more accurate because the recognizer does not have to check for bizarre sentences.
The Java Speech API 1 supports two basic grammar types: rule grammars and dictation grammars. These types differ in various ways, including how applications set up the grammars; the types of sentences they allow; how results are provided; the amount of computational resources required; and how they are used in application design. Rule grammars are defined in JSAPI 1 by JSGF, the Java Speech Grammar Format.
The Java Speech API’s classes and interfaces
The different classes and interfaces that form the Java Speech API are grouped into the following three packages:
• javax.speech: Contains classes and interfaces for a generic speech engine.
• javax.speech.synthesis: Contains classes and interfaces for speech synthesis.
• javax.speech.recognition: Contains classes and interfaces for speech recognition.
The EngineManager class is like a factory class used by all Java Speech API applications. It provides static methods to enable access to speech synthesis and speech recognition engines. The Engine interface encapsulates the generic operations that a Java Speech API-compliant speech engine should provide for speech applications.
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────